package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import io.swagger.annotations.ApiModelProperty;
import com.liao.badminton.entity.SystemRole;
import javax.validation.constraints.NotNull;
import java.util.List;
import lombok.Data;
import com.liao.badminton.code.validation.FindDetail;
import java.lang.String;
import java.util.Date;

/**
* @author liaocheng
* @date 2024-11-01
* description:角色信息表
*/
@Data
public class SystemRoleDto extends BaseField {

    @ApiModelProperty(value = "角色ID")
    @NotNull(message = "主键id不能为空",groups = {Update.class, FindDetail.class})
    private Long id;

    @ApiModelProperty(value = "角色名称")
    private String name;

    @ApiModelProperty(value = "角色权限字符串")
    private String code;

    @ApiModelProperty(value = "显示顺序")
    private Integer sort;

    @ApiModelProperty(value = "数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）")
    private Integer dataScope;

    @ApiModelProperty(value = "数据范围(指定部门数组)")
    private String dataScopeDeptIds;

    @ApiModelProperty(value = "角色状态（0正常 1停用）")
    private Integer status;

    @ApiModelProperty(value = "角色类型")
    private Integer type;

    @ApiModelProperty(value = "备注")
    private String remark;

    @NotNull(message = "主键id不能为空",groups = {Delete.class})
    private List<Long> delIds;  //批量删除ids

    public SystemRole invertEntity(){
        SystemRole dto = new SystemRole();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setName(this.getName());
        dto.setCode(this.getCode());
        dto.setSort(this.getSort());
        dto.setDataScope(this.getDataScope());
        dto.setDataScopeDeptIds(this.getDataScopeDeptIds());
        dto.setStatus(this.getStatus());
        dto.setType(this.getType());
        dto.setRemark(this.getRemark());
        return dto;
    }
}
